﻿<?xml version="1.0" encoding="utf-8" ?>
<!--namespace必须用否者就报错（读取配置文件报：未将对象引用设置到对象的实例）-->
<sqlMap namespace="" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <statements>
    <select id="GetNewsByCode" parameterClass="string" resultClass="Kaiser.Modules.Cubic.DomainModel.News.NewsDetail">
      SELECT
      cast(Id as varchar) Id,
      CreateTime as PublishDateTime,
      ContentTitle as  TitleShort,
      ContentDetail as Content,
      ContentSummary,
      Author,
      EnglishTitle,
      EnglishContent
      from  [CMS_Content]
      where Code=#value#
    </select>

    <select id="GetNews" parameterClass="string" resultClass="Kaiser.Modules.Cubic.DomainModel.News.NewsDetail">
      SELECT
      CreateTime as PublishDateTime,
      ContentTitle as  TitleShort,
      ContentDetail as Content,
      ContentSummary ,
      Author,
      EnglishTitle,
      EnglishContent
      from  [CMS_Content]
      where Id=#value#
    </select>

    <select id="GetNewsCategoryByCode" parameterClass="string" resultClass="Kaiser.Modules.Cubic.DomainModel.News.NewsCategory">
      SELECT  [Id]
      ,[CategoryCode]
      ,[CategoryName]
      ,[ParentId]
      ,[Sequence]
      ,[CategoryImg]
      ,[CategoryUrl]
      ,[ContentCount]
      ,[CategoryDesc]
      ,[SeoTitle]
      ,[SeoH1]
      ,[SeoDes]
      ,[CreateMan]
      ,[CreateTime]
      FROM  CMS_Category where [CategoryCode]=#value#
    </select>
    <select id="NewsCategory.GetAll" parameterClass="string" resultClass="Kaiser.Modules.Cubic.DomainModel.News.NewsCategory">
      SELECT  [Id]
      ,[CategoryCode]
      ,[CategoryName]
      ,[ParentId]
      ,[Sequence]
      ,[CategoryImg]
      ,[CategoryUrl]
      ,[ContentCount]
      ,[CategoryDesc]
      ,[SeoTitle]
      ,[SeoH1]
      ,[SeoDes]
      ,[CreateMan]
      ,[CreateTime]
      FROM  CMS_Category   order by  Sequence asc,id
    </select>
    
    <insert id="AddMessage" parameterClass="hashtable">
      INSERT INTO  [Cubic_Message]
      ([MessageId]
      ,[Email]
      ,[Content]
      ,[ProductName]
      ,[Company]
      ,[TelFax]
      ,[MsnSky]
      ,CreateTime)
      VALUES
      (#MessageId#
      ,#Email#
      ,#Content#
      ,#ProductName#
      ,#Company#
      ,#TelFax#
      ,#MsnSky#
      ,#CreateTime#)
    </insert>
  </statements>
</sqlMap>

